<script>
	export default {
		onLaunch: function() {
			console.log('App Launch')
		},
		onShow: async function() {
			let token = uni.getStorageSync('token');
			let _this = this;
			if(!token){
				_this.$utils.request({
					url: '/csrftoken/'
				}).then(res => {
					console.log(res,'csrftoken');
					let token = _this.$utils.extractCsrfTokens(res);
					if(!token){
						token = {csrfTokenCookie:"", csrfmiddlewareToken:""}
					}
					uni.clearStorageSync();
					uni.setStorageSync('token',token.csrfmiddlewareToken);
					uni.setStorageSync('cookie',token.csrfTokenCookie);
				})
			}
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	@import './uni.scss';
	
	::-webkit-scrollbar{
		display: none;
	}
	.container::-webkit-scrollbar,
	page::-webkit-scrollbar{
		display: none;
	}
</style>
